{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "fb6b004f",
   "metadata": {},
   "source": [
    "## 阶段五模块三大作业"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "0401186e",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[70, 70, 18,  1],\n",
       "       [ 3, 62, 65,  1],\n",
       "       [22, 26, 58,  2],\n",
       "       ...,\n",
       "       [47, 91, 38,  2],\n",
       "       [85, 48, 49,  2],\n",
       "       [93, 98, 95,  1]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "# 1.随机数生成六个班的考试成绩，3门考试：Python、数学、语文。每个班50人\n",
    "class1 = np.random.randint(0, 101, size=(50, 3))\n",
    "class2 = np.random.randint(0, 101, size=(50, 3))\n",
    "class3 = np.random.randint(0, 101, size=(50, 3))\n",
    "class4 = np.random.randint(0, 101, size=(50, 3))\n",
    "class5 = np.random.randint(0, 101, size=(50, 3))\n",
    "class6 = np.random.randint(0, 101, size=(50, 3))\n",
    "# display(class1)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "93a1828c",
   "metadata": {
    "code_folding": [],
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 70,  70,  18],\n",
       "       [  3,  62,  65],\n",
       "       [ 22,  26,  58],\n",
       "       [ 36,  34,  48],\n",
       "       [ 54,  62,  86],\n",
       "       [ 39,  85,  90],\n",
       "       [  6,  66,  18],\n",
       "       [ 86,  86,  37],\n",
       "       [ 85,  97, 100],\n",
       "       [ 20,  89,  49],\n",
       "       [ 42,  53,   0],\n",
       "       [ 62,  80,  55],\n",
       "       [  3,  79,  50],\n",
       "       [ 86,  98,  80],\n",
       "       [ 55,  36, 100],\n",
       "       [ 62,  30,  50],\n",
       "       [ 71,  82,   1],\n",
       "       [ 36,  15,  79],\n",
       "       [ 10,  17,  30],\n",
       "       [ 39,  45,  18],\n",
       "       [ 11,  55,  41],\n",
       "       [ 52,  42,   8],\n",
       "       [ 48,  54,  46],\n",
       "       [ 60,  86,  21],\n",
       "       [ 72,  15,   2],\n",
       "       [ 46,  31,  16],\n",
       "       [ 15,  56,  47],\n",
       "       [ 56,  43,  98],\n",
       "       [ 10,  81,  43],\n",
       "       [ 85,  38,  64],\n",
       "       [ 11,  55,  58],\n",
       "       [ 51,  86,  10],\n",
       "       [ 28,  90,  61],\n",
       "       [ 80,  47,  88],\n",
       "       [ 18,  36,  78],\n",
       "       [  0,  48,  86],\n",
       "       [ 92,  39,  72],\n",
       "       [  8,   2,  57],\n",
       "       [ 92,  38,  44],\n",
       "       [  8,  43,  35],\n",
       "       [ 97,  38,  81],\n",
       "       [ 18,  86,  13],\n",
       "       [ 40,  83,  38],\n",
       "       [ 83,  20,  85],\n",
       "       [ 58,  27,  31],\n",
       "       [ 99,  51,  36],\n",
       "       [ 51,  34,  62],\n",
       "       [ 39,  74,  82],\n",
       "       [ 20,  37,  94],\n",
       "       [ 36,  19,  10],\n",
       "       [  3,  19,  52],\n",
       "       [  6,  11,  29],\n",
       "       [ 31,  88,  45],\n",
       "       [ 45,  18,  42],\n",
       "       [ 75,  29,  86],\n",
       "       [  2,  80,  78],\n",
       "       [  6,  93,  35],\n",
       "       [  1,  83,  38],\n",
       "       [ 77,  16,  67],\n",
       "       [ 14,  29,  98],\n",
       "       [ 77,  31,   2],\n",
       "       [ 15,  20,  61],\n",
       "       [ 65,  15,  16],\n",
       "       [ 76,   5,  88],\n",
       "       [ 38,  75,  77],\n",
       "       [ 65,  60,  91],\n",
       "       [ 86,  95,   0],\n",
       "       [  4,  68,  56],\n",
       "       [ 89,  97,   0],\n",
       "       [ 64,  66,  62],\n",
       "       [  9,  63,  37],\n",
       "       [ 44,   2,  87],\n",
       "       [ 32,  44,  99],\n",
       "       [ 13,  85,  56],\n",
       "       [ 60,  62,  78],\n",
       "       [ 87,  13,  97],\n",
       "       [ 48, 100,  89],\n",
       "       [ 33,  17,  49],\n",
       "       [ 66,  42,  82],\n",
       "       [  8,  41,  81],\n",
       "       [ 61,  15,  63],\n",
       "       [  5,  83,  56],\n",
       "       [ 98,  74,  42],\n",
       "       [ 77,  31,  80],\n",
       "       [ 76,  63,  73],\n",
       "       [ 38,  48,   1],\n",
       "       [ 87,  54,  54],\n",
       "       [ 92,   2,  66],\n",
       "       [  9,  48,  13],\n",
       "       [  0,  16,  60],\n",
       "       [ 85,  30,  37],\n",
       "       [ 83,  12,   3],\n",
       "       [ 64,  18,  39],\n",
       "       [ 17,  70,  40],\n",
       "       [ 46,  16,  65],\n",
       "       [ 40,  60,  30],\n",
       "       [ 55,  68,   1],\n",
       "       [ 52,   5,  56],\n",
       "       [ 47,  93,  33],\n",
       "       [ 72,  56,  49],\n",
       "       [ 43,   1,  29],\n",
       "       [ 58,  86,  68],\n",
       "       [ 88,  77,  61],\n",
       "       [ 42,  39, 100],\n",
       "       [ 58,  86,  63],\n",
       "       [ 53,  75,   4],\n",
       "       [ 73,  50,  55],\n",
       "       [ 76,  96,  72],\n",
       "       [ 28,   6,   8],\n",
       "       [ 19,  45,  27],\n",
       "       [ 52,  82,  74],\n",
       "       [ 89,  85,  47],\n",
       "       [ 56,  50,  63],\n",
       "       [ 78,  27,  90],\n",
       "       [ 19,  52,  85],\n",
       "       [ 21,  11,  58],\n",
       "       [ 51,  70,  52],\n",
       "       [ 76,  80,  65],\n",
       "       [ 90,  89,  94],\n",
       "       [ 89,  76,  73],\n",
       "       [ 40,  42,  46],\n",
       "       [ 93,  85,  47],\n",
       "       [ 68,  48,   3],\n",
       "       [ 70,  96,  44],\n",
       "       [ 79,  42,  88],\n",
       "       [ 49,   2,  18],\n",
       "       [ 58,  65,  91],\n",
       "       [ 16,  60,  98],\n",
       "       [ 48,  26,  78],\n",
       "       [ 41,  57,  69],\n",
       "       [ 32,  65,  65],\n",
       "       [ 35,  21,  97],\n",
       "       [ 49,  26,  29],\n",
       "       [ 86,   3,   0],\n",
       "       [ 96,  15,  29],\n",
       "       [ 27,  57,   9],\n",
       "       [ 23,   9,  32],\n",
       "       [ 62,  93,  51],\n",
       "       [ 29,  14,  87],\n",
       "       [ 76,  46,  69],\n",
       "       [ 34,  54,  36],\n",
       "       [ 10,  15,   5],\n",
       "       [  1,  12,  43],\n",
       "       [ 78,  64,  57],\n",
       "       [ 90,  82,  71],\n",
       "       [ 39,  71,  31],\n",
       "       [ 27,   8,  78],\n",
       "       [  8,  86,  57],\n",
       "       [ 84,  17,  99],\n",
       "       [ 93,  41,   9],\n",
       "       [ 63,  19,  22],\n",
       "       [ 10,  95,  67],\n",
       "       [  3,  48,  57],\n",
       "       [ 60,  71,  95],\n",
       "       [ 65,  23,  41],\n",
       "       [ 37,  19,  40],\n",
       "       [ 48,  33,  87],\n",
       "       [ 34,  43,  58],\n",
       "       [ 29,   6,  99],\n",
       "       [ 33,  73,   3],\n",
       "       [ 14,  36,  37],\n",
       "       [ 77,  95,  90],\n",
       "       [ 11,  38,  29],\n",
       "       [ 16,  98,  56],\n",
       "       [ 34,  31,  30],\n",
       "       [ 53,  46,  18],\n",
       "       [ 58,  60,  81],\n",
       "       [ 28,   5,  60],\n",
       "       [ 52,  41,  25],\n",
       "       [ 22,  85,  59],\n",
       "       [ 88,  13,  45],\n",
       "       [ 66,  64,  33],\n",
       "       [ 34,  25,  40],\n",
       "       [ 82,  99,  77],\n",
       "       [ 66,  90,   0],\n",
       "       [ 85,  30,  67],\n",
       "       [ 27,  18,  41],\n",
       "       [ 59,  50,  11],\n",
       "       [ 41,   5,  42],\n",
       "       [ 91,   7,  78],\n",
       "       [  6,  51,  90],\n",
       "       [ 23,  76,  49],\n",
       "       [ 35,  85,  34],\n",
       "       [  0,  18,  61],\n",
       "       [ 94,  44,   8],\n",
       "       [ 31,  46,  93],\n",
       "       [ 56,  49,  44],\n",
       "       [ 18,  27,  63],\n",
       "       [ 34,  41,  43],\n",
       "       [ 64,  82,  65],\n",
       "       [ 93,  52,  83],\n",
       "       [ 62,  95,  80],\n",
       "       [ 33,  88,  37],\n",
       "       [ 80,  84,  39],\n",
       "       [  8,  10,  17],\n",
       "       [ 60,  70,  92],\n",
       "       [ 10,  51,   0],\n",
       "       [ 11,  14,  42],\n",
       "       [ 97,  63,  84],\n",
       "       [ 61,  26,  92],\n",
       "       [ 95,  37,  18],\n",
       "       [ 11,  27,  48],\n",
       "       [ 29,  67,  17],\n",
       "       [ 88,  11,  16],\n",
       "       [ 45,  88,  25],\n",
       "       [  9,  34,   6],\n",
       "       [ 70,  42,  80],\n",
       "       [ 90,  63, 100],\n",
       "       [ 70,  42,  34],\n",
       "       [ 75,  80,  50],\n",
       "       [ 95,   5,  47],\n",
       "       [  1,  10,  95],\n",
       "       [ 18,  23,  66],\n",
       "       [ 26,  43,  68],\n",
       "       [ 41, 100,  22],\n",
       "       [ 46,   3,  94],\n",
       "       [ 75,  95,  90],\n",
       "       [ 76,  83,   2],\n",
       "       [ 45,  33,  21],\n",
       "       [ 10,  76,  37],\n",
       "       [ 33,   9,  71],\n",
       "       [ 79,  56,  60],\n",
       "       [ 87,  48,  22],\n",
       "       [ 18,  72,  73],\n",
       "       [ 42,  54,  54],\n",
       "       [ 43,  69,   6],\n",
       "       [ 35,  94,  57],\n",
       "       [ 96,  50,  29],\n",
       "       [ 51,  72,  32],\n",
       "       [ 61,  45,  83],\n",
       "       [ 58,  73,  11],\n",
       "       [ 73,  46,   7],\n",
       "       [ 70,  65,  30],\n",
       "       [ 95,  81,  98],\n",
       "       [ 32,   3,  13],\n",
       "       [ 63,  63,  59],\n",
       "       [ 42,  50,  22],\n",
       "       [  6,  61,  35],\n",
       "       [ 83,  40,  47],\n",
       "       [ 40,   7,  68],\n",
       "       [ 42,  65,  71],\n",
       "       [  8, 100,  80],\n",
       "       [ 44,  48,   1],\n",
       "       [ 96,  98,  54],\n",
       "       [ 37,  51,  81],\n",
       "       [ 17,   1,  27],\n",
       "       [ 89,  62,  18],\n",
       "       [ 27,  73,  30],\n",
       "       [ 59,  16,  13],\n",
       "       [ 92,  59,  35],\n",
       "       [ 51,  55,  26],\n",
       "       [ 25,  20,  66],\n",
       "       [ 53,  51,  54],\n",
       "       [ 83,  53,  35],\n",
       "       [ 33,  12,  85],\n",
       "       [ 61, 100,  64],\n",
       "       [  1,  34,  82],\n",
       "       [ 53,  75,  89],\n",
       "       [ 91,  92,  51],\n",
       "       [ 64,  75,  92],\n",
       "       [ 93,  77,   4],\n",
       "       [ 17,  14,  46],\n",
       "       [ 76,  89,   6],\n",
       "       [ 86,  86,  71],\n",
       "       [ 21,  92,  23],\n",
       "       [ 33,  42,   6],\n",
       "       [ 20,  88,  46],\n",
       "       [ 56,  78,  78],\n",
       "       [ 35,   1,  10],\n",
       "       [ 60,  55, 100],\n",
       "       [ 86,  95,  65],\n",
       "       [ 76,  98,  63],\n",
       "       [ 23,  20,  77],\n",
       "       [ 33,   0,   1],\n",
       "       [ 33,  42,  93],\n",
       "       [  7,  41,  67],\n",
       "       [ 41,  87,  25],\n",
       "       [  4,  13,  98],\n",
       "       [ 34,  12,  21],\n",
       "       [  8,  61,  64],\n",
       "       [ 94,  40,  69],\n",
       "       [ 70,  81,  49],\n",
       "       [ 82,   0,  54],\n",
       "       [ 64,  40,  97],\n",
       "       [ 66,  10,  14],\n",
       "       [  8,  32, 100],\n",
       "       [ 41,  83,   3],\n",
       "       [ 30,  15,  74],\n",
       "       [ 54,  42,  97],\n",
       "       [ 45,  55,  15],\n",
       "       [ 52,  47,  51],\n",
       "       [  8,  34,  20],\n",
       "       [ 14,  79,  38],\n",
       "       [ 57, 100,  24],\n",
       "       [ 87,  19,  44],\n",
       "       [ 78,  77,  51],\n",
       "       [ 11,  55,  31],\n",
       "       [ 47,  91,  38],\n",
       "       [ 85,  48,  49],\n",
       "       [ 93,  98,  95]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 2.将六个班的考试成绩进行合并得到score\n",
    "score = np.vstack((class1, class2, class3, class4, class5, class6))\n",
    "# display(score)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "1b11102f",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1],\n",
       "       [2],\n",
       "       [2],\n",
       "       [1],\n",
       "       [2],\n",
       "       [1],\n",
       "       [1]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 3.生成性别数组sex，水平叠加数组sex和score得到data\n",
    "sex = np.random.randint(1, 3, size=(300, 1))\n",
    "display(sex)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "14d6125e",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[70, 70, 18,  1],\n",
       "       [ 3, 62, 65,  2],\n",
       "       [22, 26, 58,  1],\n",
       "       ...,\n",
       "       [47, 91, 38,  1],\n",
       "       [85, 48, 49,  1],\n",
       "       [93, 98, 95,  1]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data = np.hstack((score, sex))\n",
    "display(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "408dd625",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 70,  70,  18,   1],\n",
       "       [ 22,  26,  58,   1],\n",
       "       [  6,  66,  18,   1],\n",
       "       [ 62,  80,  55,   1],\n",
       "       [ 55,  36, 100,   1],\n",
       "       [ 71,  82,   1,   1],\n",
       "       [ 39,  45,  18,   1],\n",
       "       [ 52,  42,   8,   1],\n",
       "       [ 48,  54,  46,   1],\n",
       "       [ 46,  31,  16,   1],\n",
       "       [ 10,  81,  43,   1],\n",
       "       [ 11,  55,  58,   1],\n",
       "       [ 80,  47,  88,   1],\n",
       "       [ 18,  36,  78,   1],\n",
       "       [  8,   2,  57,   1],\n",
       "       [  8,  43,  35,   1],\n",
       "       [ 99,  51,  36,   1],\n",
       "       [ 51,  34,  62,   1],\n",
       "       [ 39,  74,  82,   1],\n",
       "       [ 20,  37,  94,   1],\n",
       "       [  3,  19,  52,   1],\n",
       "       [ 45,  18,  42,   1],\n",
       "       [ 75,  29,  86,   1],\n",
       "       [  6,  93,  35,   1],\n",
       "       [ 77,  31,   2,   1],\n",
       "       [ 65,  60,  91,   1],\n",
       "       [ 89,  97,   0,   1],\n",
       "       [ 64,  66,  62,   1],\n",
       "       [  9,  63,  37,   1],\n",
       "       [ 32,  44,  99,   1],\n",
       "       [ 87,  13,  97,   1],\n",
       "       [ 33,  17,  49,   1],\n",
       "       [ 98,  74,  42,   1],\n",
       "       [ 76,  63,  73,   1],\n",
       "       [ 87,  54,  54,   1],\n",
       "       [  9,  48,  13,   1],\n",
       "       [ 64,  18,  39,   1],\n",
       "       [ 17,  70,  40,   1],\n",
       "       [ 40,  60,  30,   1],\n",
       "       [ 55,  68,   1,   1],\n",
       "       [ 52,   5,  56,   1],\n",
       "       [ 43,   1,  29,   1],\n",
       "       [ 88,  77,  61,   1],\n",
       "       [ 42,  39, 100,   1],\n",
       "       [ 58,  86,  63,   1],\n",
       "       [ 53,  75,   4,   1],\n",
       "       [ 73,  50,  55,   1],\n",
       "       [ 76,  96,  72,   1],\n",
       "       [ 19,  45,  27,   1],\n",
       "       [ 89,  85,  47,   1],\n",
       "       [ 56,  50,  63,   1],\n",
       "       [ 78,  27,  90,   1],\n",
       "       [ 51,  70,  52,   1],\n",
       "       [ 89,  76,  73,   1],\n",
       "       [ 93,  85,  47,   1],\n",
       "       [ 68,  48,   3,   1],\n",
       "       [ 58,  65,  91,   1],\n",
       "       [ 32,  65,  65,   1],\n",
       "       [ 35,  21,  97,   1],\n",
       "       [ 86,   3,   0,   1],\n",
       "       [ 34,  54,  36,   1],\n",
       "       [ 10,  15,   5,   1],\n",
       "       [ 78,  64,  57,   1],\n",
       "       [ 39,  71,  31,   1],\n",
       "       [ 27,   8,  78,   1],\n",
       "       [ 84,  17,  99,   1],\n",
       "       [ 10,  95,  67,   1],\n",
       "       [ 60,  71,  95,   1],\n",
       "       [ 65,  23,  41,   1],\n",
       "       [ 37,  19,  40,   1],\n",
       "       [ 29,   6,  99,   1],\n",
       "       [ 77,  95,  90,   1],\n",
       "       [ 11,  38,  29,   1],\n",
       "       [ 34,  31,  30,   1],\n",
       "       [ 53,  46,  18,   1],\n",
       "       [ 28,   5,  60,   1],\n",
       "       [ 52,  41,  25,   1],\n",
       "       [ 66,  64,  33,   1],\n",
       "       [ 34,  25,  40,   1],\n",
       "       [ 82,  99,  77,   1],\n",
       "       [ 66,  90,   0,   1],\n",
       "       [ 85,  30,  67,   1],\n",
       "       [ 27,  18,  41,   1],\n",
       "       [ 59,  50,  11,   1],\n",
       "       [ 41,   5,  42,   1],\n",
       "       [ 91,   7,  78,   1],\n",
       "       [  6,  51,  90,   1],\n",
       "       [ 35,  85,  34,   1],\n",
       "       [  0,  18,  61,   1],\n",
       "       [ 31,  46,  93,   1],\n",
       "       [ 18,  27,  63,   1],\n",
       "       [ 34,  41,  43,   1],\n",
       "       [ 64,  82,  65,   1],\n",
       "       [ 33,  88,  37,   1],\n",
       "       [ 10,  51,   0,   1],\n",
       "       [ 97,  63,  84,   1],\n",
       "       [ 95,  37,  18,   1],\n",
       "       [ 11,  27,  48,   1],\n",
       "       [ 88,  11,  16,   1],\n",
       "       [ 45,  88,  25,   1],\n",
       "       [  9,  34,   6,   1],\n",
       "       [ 70,  42,  80,   1],\n",
       "       [ 90,  63, 100,   1],\n",
       "       [ 70,  42,  34,   1],\n",
       "       [  1,  10,  95,   1],\n",
       "       [ 18,  23,  66,   1],\n",
       "       [ 26,  43,  68,   1],\n",
       "       [ 41, 100,  22,   1],\n",
       "       [ 75,  95,  90,   1],\n",
       "       [ 45,  33,  21,   1],\n",
       "       [ 43,  69,   6,   1],\n",
       "       [ 61,  45,  83,   1],\n",
       "       [ 70,  65,  30,   1],\n",
       "       [ 95,  81,  98,   1],\n",
       "       [ 32,   3,  13,   1],\n",
       "       [ 63,  63,  59,   1],\n",
       "       [  6,  61,  35,   1],\n",
       "       [ 83,  40,  47,   1],\n",
       "       [ 40,   7,  68,   1],\n",
       "       [ 42,  65,  71,   1],\n",
       "       [ 17,   1,  27,   1],\n",
       "       [ 53,  51,  54,   1],\n",
       "       [ 33,  12,  85,   1],\n",
       "       [ 61, 100,  64,   1],\n",
       "       [  1,  34,  82,   1],\n",
       "       [ 64,  75,  92,   1],\n",
       "       [ 17,  14,  46,   1],\n",
       "       [ 86,  86,  71,   1],\n",
       "       [ 33,  42,   6,   1],\n",
       "       [ 20,  88,  46,   1],\n",
       "       [ 86,  95,  65,   1],\n",
       "       [ 34,  12,  21,   1],\n",
       "       [  8,  61,  64,   1],\n",
       "       [ 70,  81,  49,   1],\n",
       "       [ 82,   0,  54,   1],\n",
       "       [ 41,  83,   3,   1],\n",
       "       [ 54,  42,  97,   1],\n",
       "       [ 45,  55,  15,   1],\n",
       "       [ 52,  47,  51,   1],\n",
       "       [  8,  34,  20,   1],\n",
       "       [ 14,  79,  38,   1],\n",
       "       [ 78,  77,  51,   1],\n",
       "       [ 47,  91,  38,   1],\n",
       "       [ 85,  48,  49,   1],\n",
       "       [ 93,  98,  95,   1]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[  3,  62,  65,   2],\n",
       "       [ 36,  34,  48,   2],\n",
       "       [ 54,  62,  86,   2],\n",
       "       [ 39,  85,  90,   2],\n",
       "       [ 86,  86,  37,   2],\n",
       "       [ 85,  97, 100,   2],\n",
       "       [ 20,  89,  49,   2],\n",
       "       [ 42,  53,   0,   2],\n",
       "       [  3,  79,  50,   2],\n",
       "       [ 86,  98,  80,   2],\n",
       "       [ 62,  30,  50,   2],\n",
       "       [ 36,  15,  79,   2],\n",
       "       [ 10,  17,  30,   2],\n",
       "       [ 11,  55,  41,   2],\n",
       "       [ 60,  86,  21,   2],\n",
       "       [ 72,  15,   2,   2],\n",
       "       [ 15,  56,  47,   2],\n",
       "       [ 56,  43,  98,   2],\n",
       "       [ 85,  38,  64,   2],\n",
       "       [ 51,  86,  10,   2],\n",
       "       [ 28,  90,  61,   2],\n",
       "       [  0,  48,  86,   2],\n",
       "       [ 92,  39,  72,   2],\n",
       "       [ 92,  38,  44,   2],\n",
       "       [ 97,  38,  81,   2],\n",
       "       [ 18,  86,  13,   2],\n",
       "       [ 40,  83,  38,   2],\n",
       "       [ 83,  20,  85,   2],\n",
       "       [ 58,  27,  31,   2],\n",
       "       [ 36,  19,  10,   2],\n",
       "       [  6,  11,  29,   2],\n",
       "       [ 31,  88,  45,   2],\n",
       "       [  2,  80,  78,   2],\n",
       "       [  1,  83,  38,   2],\n",
       "       [ 77,  16,  67,   2],\n",
       "       [ 14,  29,  98,   2],\n",
       "       [ 15,  20,  61,   2],\n",
       "       [ 65,  15,  16,   2],\n",
       "       [ 76,   5,  88,   2],\n",
       "       [ 38,  75,  77,   2],\n",
       "       [ 86,  95,   0,   2],\n",
       "       [  4,  68,  56,   2],\n",
       "       [ 44,   2,  87,   2],\n",
       "       [ 13,  85,  56,   2],\n",
       "       [ 60,  62,  78,   2],\n",
       "       [ 48, 100,  89,   2],\n",
       "       [ 66,  42,  82,   2],\n",
       "       [  8,  41,  81,   2],\n",
       "       [ 61,  15,  63,   2],\n",
       "       [  5,  83,  56,   2],\n",
       "       [ 77,  31,  80,   2],\n",
       "       [ 38,  48,   1,   2],\n",
       "       [ 92,   2,  66,   2],\n",
       "       [  0,  16,  60,   2],\n",
       "       [ 85,  30,  37,   2],\n",
       "       [ 83,  12,   3,   2],\n",
       "       [ 46,  16,  65,   2],\n",
       "       [ 47,  93,  33,   2],\n",
       "       [ 72,  56,  49,   2],\n",
       "       [ 58,  86,  68,   2],\n",
       "       [ 28,   6,   8,   2],\n",
       "       [ 52,  82,  74,   2],\n",
       "       [ 19,  52,  85,   2],\n",
       "       [ 21,  11,  58,   2],\n",
       "       [ 76,  80,  65,   2],\n",
       "       [ 90,  89,  94,   2],\n",
       "       [ 40,  42,  46,   2],\n",
       "       [ 70,  96,  44,   2],\n",
       "       [ 79,  42,  88,   2],\n",
       "       [ 49,   2,  18,   2],\n",
       "       [ 16,  60,  98,   2],\n",
       "       [ 48,  26,  78,   2],\n",
       "       [ 41,  57,  69,   2],\n",
       "       [ 49,  26,  29,   2],\n",
       "       [ 96,  15,  29,   2],\n",
       "       [ 27,  57,   9,   2],\n",
       "       [ 23,   9,  32,   2],\n",
       "       [ 62,  93,  51,   2],\n",
       "       [ 29,  14,  87,   2],\n",
       "       [ 76,  46,  69,   2],\n",
       "       [  1,  12,  43,   2],\n",
       "       [ 90,  82,  71,   2],\n",
       "       [  8,  86,  57,   2],\n",
       "       [ 93,  41,   9,   2],\n",
       "       [ 63,  19,  22,   2],\n",
       "       [  3,  48,  57,   2],\n",
       "       [ 48,  33,  87,   2],\n",
       "       [ 34,  43,  58,   2],\n",
       "       [ 33,  73,   3,   2],\n",
       "       [ 14,  36,  37,   2],\n",
       "       [ 16,  98,  56,   2],\n",
       "       [ 58,  60,  81,   2],\n",
       "       [ 22,  85,  59,   2],\n",
       "       [ 88,  13,  45,   2],\n",
       "       [ 23,  76,  49,   2],\n",
       "       [ 94,  44,   8,   2],\n",
       "       [ 56,  49,  44,   2],\n",
       "       [ 93,  52,  83,   2],\n",
       "       [ 62,  95,  80,   2],\n",
       "       [ 80,  84,  39,   2],\n",
       "       [  8,  10,  17,   2],\n",
       "       [ 60,  70,  92,   2],\n",
       "       [ 11,  14,  42,   2],\n",
       "       [ 61,  26,  92,   2],\n",
       "       [ 29,  67,  17,   2],\n",
       "       [ 75,  80,  50,   2],\n",
       "       [ 95,   5,  47,   2],\n",
       "       [ 46,   3,  94,   2],\n",
       "       [ 76,  83,   2,   2],\n",
       "       [ 10,  76,  37,   2],\n",
       "       [ 33,   9,  71,   2],\n",
       "       [ 79,  56,  60,   2],\n",
       "       [ 87,  48,  22,   2],\n",
       "       [ 18,  72,  73,   2],\n",
       "       [ 42,  54,  54,   2],\n",
       "       [ 35,  94,  57,   2],\n",
       "       [ 96,  50,  29,   2],\n",
       "       [ 51,  72,  32,   2],\n",
       "       [ 58,  73,  11,   2],\n",
       "       [ 73,  46,   7,   2],\n",
       "       [ 42,  50,  22,   2],\n",
       "       [  8, 100,  80,   2],\n",
       "       [ 44,  48,   1,   2],\n",
       "       [ 96,  98,  54,   2],\n",
       "       [ 37,  51,  81,   2],\n",
       "       [ 89,  62,  18,   2],\n",
       "       [ 27,  73,  30,   2],\n",
       "       [ 59,  16,  13,   2],\n",
       "       [ 92,  59,  35,   2],\n",
       "       [ 51,  55,  26,   2],\n",
       "       [ 25,  20,  66,   2],\n",
       "       [ 83,  53,  35,   2],\n",
       "       [ 53,  75,  89,   2],\n",
       "       [ 91,  92,  51,   2],\n",
       "       [ 93,  77,   4,   2],\n",
       "       [ 76,  89,   6,   2],\n",
       "       [ 21,  92,  23,   2],\n",
       "       [ 56,  78,  78,   2],\n",
       "       [ 35,   1,  10,   2],\n",
       "       [ 60,  55, 100,   2],\n",
       "       [ 76,  98,  63,   2],\n",
       "       [ 23,  20,  77,   2],\n",
       "       [ 33,   0,   1,   2],\n",
       "       [ 33,  42,  93,   2],\n",
       "       [  7,  41,  67,   2],\n",
       "       [ 41,  87,  25,   2],\n",
       "       [  4,  13,  98,   2],\n",
       "       [ 94,  40,  69,   2],\n",
       "       [ 64,  40,  97,   2],\n",
       "       [ 66,  10,  14,   2],\n",
       "       [  8,  32, 100,   2],\n",
       "       [ 30,  15,  74,   2],\n",
       "       [ 57, 100,  24,   2],\n",
       "       [ 87,  19,  44,   2],\n",
       "       [ 11,  55,  31,   2]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 4.分别计算男女生各科成绩统计指标：最小值、最大值、平均分、中位数、标准差\n",
    "# 先分别取出男生和女生的成绩，男生=1，女生=2\n",
    "boys_data = data[data[:,-1]==1].copy()\n",
    "girls_data = data[data[:,-1]==2].copy()\n",
    "display(boys_data, girls_data)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "55f880cb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "男生Python成绩如下：\n",
      "\n",
      "简单排序 [ 0  1  1  3  6  6  6  6  8  8  8  8  9  9  9 10 10 10 10 11 11 11 14 17\n",
      " 17 17 18 18 18 19 20 20 22 26 27 27 28 29 31 32 32 32 33 33 33 33 34 34\n",
      " 34 34 34 35 35 37 39 39 39 40 40 41 41 41 42 42 43 43 45 45 45 45 46 47\n",
      " 48 51 51 52 52 52 52 53 53 53 54 55 55 56 58 58 59 60 61 61 62 63 64 64\n",
      " 64 64 65 65 66 66 68 70 70 70 70 70 71 73 75 75 76 76 77 77 78 78 78 80\n",
      " 82 82 83 84 85 85 86 86 86 87 87 88 88 89 89 89 90 91 93 93 95 95 97 98\n",
      " 99]\n",
      "去掉重复值 [ 0  1  3  6  8  9 10 11 14 17 18 19 20 22 26 27 28 29 31 32 33 34 35 37\n",
      " 39 40 41 42 43 45 46 47 48 51 52 53 54 55 56 58 59 60 61 62 63 64 65 66\n",
      " 68 70 71 73 75 76 77 78 80 82 83 84 85 86 87 88 89 90 91 93 95 97 98 99]\n",
      "男生最低分数 0\n",
      "男生最高分数 99\n",
      "男生平均分数 49.0\n",
      "男生中位数分数 48.0\n",
      "男生分数标准差 27.74\n",
      "\n",
      "\n",
      "男生数学成绩如下：\n",
      "\n",
      "简单排序 [  0   1   1   2   3   3   5   5   5   6   7   7   8  10  11  12  12  13\n",
      "  14  15  17  17  18  18  18  18  19  19  21  23  23  25  26  27  27  27\n",
      "  29  30  31  31  31  33  34  34  34  34  36  36  37  37  38  39  40  41\n",
      "  41  42  42  42  42  42  43  43  44  45  45  45  46  46  47  47  48  48\n",
      "  48  50  50  50  51  51  51  51  54  54  54  55  55  60  60  61  61  63\n",
      "  63  63  63  63  64  64  65  65  65  65  66  66  68  69  70  70  70  71\n",
      "  71  74  74  75  75  76  77  77  79  80  81  81  81  82  82  83  85  85\n",
      "  85  86  86  88  88  88  90  91  93  95  95  95  95  96  97  98  99 100\n",
      " 100]\n",
      "去掉重复值 [  0   1   2   3   5   6   7   8  10  11  12  13  14  15  17  18  19  21\n",
      "  23  25  26  27  29  30  31  33  34  36  37  38  39  40  41  42  43  44\n",
      "  45  46  47  48  50  51  54  55  60  61  63  64  65  66  68  69  70  71\n",
      "  74  75  76  77  79  80  81  82  83  85  86  88  90  91  93  95  96  97\n",
      "  98  99 100]\n",
      "男生最低分数 0\n",
      "男生最高分数 100\n",
      "男生平均分数 50.0\n",
      "男生中位数分数 48.0\n",
      "男生分数标准差 27.78\n",
      "\n",
      "\n",
      "男生语文成绩如下：\n",
      "\n",
      "简单排序 [  0   0   0   0   1   1   2   3   3   4   5   6   6   6   8  11  13  13\n",
      "  15  16  16  18  18  18  18  18  20  21  21  22  25  25  27  27  29  29\n",
      "  30  30  30  31  33  34  34  35  35  35  36  36  37  37  38  38  39  40\n",
      "  40  40  41  41  42  42  42  43  43  46  46  46  47  47  47  48  49  49\n",
      "  49  51  51  52  52  54  54  54  55  55  56  57  57  58  58  59  60  61\n",
      "  61  62  62  63  63  63  64  64  65  65  65  66  67  67  68  68  71  71\n",
      "  72  73  73  77  78  78  78  80  82  82  83  84  85  86  88  90  90  90\n",
      "  90  91  91  92  93  94  95  95  95  97  97  97  98  99  99  99 100 100\n",
      " 100]\n",
      "去掉重复值 [  0   1   2   3   4   5   6   8  11  13  15  16  18  20  21  22  25  27\n",
      "  29  30  31  33  34  35  36  37  38  39  40  41  42  43  46  47  48  49\n",
      "  51  52  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  71\n",
      "  72  73  77  78  80  82  83  84  85  86  88  90  91  92  93  94  95  97\n",
      "  98  99 100]\n",
      "男生最低分数 0\n",
      "男生最高分数 100\n",
      "男生平均分数 51.0\n",
      "男生中位数分数 49.0\n",
      "男生分数标准差 28.94\n"
     ]
    }
   ],
   "source": [
    "# 取出男生不同科目的成绩进行计算\n",
    "# 0 Python, 1数学 math, 2语文 Chinese\n",
    "boy_py_score = boys_data[:,0].copy()\n",
    "print('男生Python成绩如下：')\n",
    "print()\n",
    "boy_py_score.sort()\n",
    "print('简单排序', boy_py_score)\n",
    "print('去掉重复值', np.unique(boy_py_score))\n",
    "boys_py_min = np.min(boy_py_score)\n",
    "print('男生最低分数',boys_py_min)\n",
    "boys_py_max = np.max(boy_py_score)\n",
    "print('男生最高分数', boys_py_max)\n",
    "boys_py_max = np.round(np.mean(boy_py_score),0)\n",
    "print('男生平均分数', boys_py_max)\n",
    "boys_py_median = np.median(boy_py_score)\n",
    "print('男生中位数分数', boys_py_median)\n",
    "boys_py_std = np.round(np.std(boy_py_score),2)\n",
    "print('男生分数标准差', boys_py_std)\n",
    "\n",
    "\n",
    "print()\n",
    "print()\n",
    "boy_math_score = boys_data[:,1].copy()\n",
    "print('男生数学成绩如下：')\n",
    "print()\n",
    "boy_math_score.sort()\n",
    "print('简单排序', boy_math_score)\n",
    "print('去掉重复值', np.unique(boy_math_score))\n",
    "boys_math_min = np.min(boy_math_score)\n",
    "print('男生最低分数',boys_math_min)\n",
    "boys_math_max = np.max(boy_math_score)\n",
    "print('男生最高分数', boys_math_max)\n",
    "boys_math_mean = np.round(np.mean(boy_math_score),0)\n",
    "print('男生平均分数', boys_math_mean)\n",
    "boys_math_median = np.median(boy_math_score)\n",
    "print('男生中位数分数', boys_math_median)\n",
    "boys_math_std = np.round(np.std(boy_math_score),2)\n",
    "print('男生分数标准差', boys_math_std)\n",
    "\n",
    "\n",
    "print()\n",
    "print()\n",
    "boy_chinese_score = boys_data[:,2].copy()\n",
    "print('男生语文成绩如下：')\n",
    "print()\n",
    "boy_chinese_score.sort()\n",
    "print('简单排序', boy_chinese_score)\n",
    "print('去掉重复值', np.unique(boy_chinese_score))\n",
    "boys_chinese_min = np.min(boy_chinese_score)\n",
    "print('男生最低分数',boys_chinese_min)\n",
    "boys_chinese_max = np.max(boy_chinese_score)\n",
    "print('男生最高分数', boys_chinese_max)\n",
    "boys_chinese_mean = np.round(np.mean(boy_chinese_score),0)\n",
    "print('男生平均分数', boys_chinese_mean)\n",
    "boys_chinese_median = np.median(boy_chinese_score)\n",
    "print('男生中位数分数', boys_chinese_median)\n",
    "boys_chinese_std = np.round(np.std(boy_chinese_score),2)\n",
    "print('男生分数标准差', boys_chinese_std)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "8a4e667b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "女生Python成绩如下：\n",
      "\n",
      "简单排序 [ 0  0  1  1  2  3  3  3  4  4  5  6  7  8  8  8  8  8 10 10 11 11 11 13\n",
      " 14 14 15 15 16 16 18 18 19 20 21 21 22 23 23 23 25 27 27 28 28 29 29 30\n",
      " 31 33 33 33 33 34 35 35 36 36 36 37 38 38 39 40 40 41 41 42 42 42 44 44\n",
      " 46 46 47 48 48 48 49 49 51 51 51 52 53 54 56 56 56 57 58 58 58 58 59 60\n",
      " 60 60 60 61 61 62 62 62 63 64 65 66 66 70 72 72 73 75 76 76 76 76 76 76\n",
      " 77 77 79 79 80 83 83 83 85 85 85 86 86 86 87 87 88 89 90 90 91 92 92 92\n",
      " 92 93 93 93 94 94 95 96 96 96 97]\n",
      "去掉重复值 [ 0  1  2  3  4  5  6  7  8 10 11 13 14 15 16 18 19 20 21 22 23 25 27 28\n",
      " 29 30 31 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 51 52 53 54 56 57\n",
      " 58 59 60 61 62 63 64 65 66 70 72 73 75 76 77 79 80 83 85 86 87 88 89 90\n",
      " 91 92 93 94 95 96 97]\n",
      "女生最低分数 0\n",
      "女生最高分数 97\n",
      "女生平均分数 49.0\n",
      "女生中位数分数 48.0\n",
      "女生分数标准差 29.2\n",
      "\n",
      "\n",
      "女生数学成绩如下：\n",
      "\n",
      "简单排序 [  0   1   2   2   2   3   5   5   6   9   9  10  10  11  11  12  12  13\n",
      "  13  14  14  15  15  15  15  15  15  16  16  16  16  17  19  19  19  20\n",
      "  20  20  20  26  26  26  27  29  30  30  31  32  33  34  36  38  38  38\n",
      "  39  40  40  41  41  41  42  42  42  42  43  43  44  46  46  48  48  48\n",
      "  48  48  49  50  50  51  52  52  53  53  54  55  55  55  55  56  56  56\n",
      "  57  57  59  60  60  62  62  62  62  67  68  70  72  72  73  73  73  75\n",
      "  75  76  76  77  78  79  80  80  80  82  82  83  83  83  83  84  85  85\n",
      "  85  86  86  86  86  86  86  87  88  89  89  89  90  92  92  93  93  94\n",
      "  95  95  96  97  98  98  98  98 100 100 100]\n",
      "去掉重复值 [  0   1   2   3   5   6   9  10  11  12  13  14  15  16  17  19  20  26\n",
      "  27  29  30  31  32  33  34  36  38  39  40  41  42  43  44  46  48  49\n",
      "  50  51  52  53  54  55  56  57  59  60  62  67  68  70  72  73  75  76\n",
      "  77  78  79  80  82  83  84  85  86  87  88  89  90  92  93  94  95  96\n",
      "  97  98 100]\n",
      "女生最低分数 0\n",
      "女生最高分数 100\n",
      "女生平均分数 51.0\n",
      "女生中位数分数 51.0\n",
      "女生分数标准差 29.85\n",
      "\n",
      "\n",
      "女生语文成绩如下：\n",
      "\n",
      "简单排序 [  0   0   1   1   1   2   2   3   3   4   6   7   8   8   9   9  10  10\n",
      "  10  11  13  13  14  16  17  17  18  18  21  22  22  22  23  24  25  26\n",
      "  29  29  29  29  30  30  31  31  32  32  33  35  35  37  37  37  37  38\n",
      "  38  39  41  42  43  44  44  44  44  45  45  46  47  47  48  49  49  49\n",
      "  50  50  50  51  51  54  54  56  56  56  56  57  57  57  58  58  59  60\n",
      "  60  61  61  63  63  64  65  65  65  66  66  67  67  68  69  69  69  71\n",
      "  71  72  73  74  74  77  77  78  78  78  78  79  80  80  80  80  81  81\n",
      "  81  81  82  83  85  85  86  86  87  87  87  88  88  89  89  90  92  92\n",
      "  93  94  94  97  98  98  98  98 100 100 100]\n",
      "去掉重复值 [  0   1   2   3   4   6   7   8   9  10  11  13  14  16  17  18  21  22\n",
      "  23  24  25  26  29  30  31  32  33  35  37  38  39  41  42  43  44  45\n",
      "  46  47  48  49  50  51  54  56  57  58  59  60  61  63  64  65  66  67\n",
      "  68  69  71  72  73  74  77  78  79  80  81  82  83  85  86  87  88  89\n",
      "  90  92  93  94  97  98 100]\n",
      "女生最低分数 0\n",
      "女生最高分数 100\n",
      "女生平均分数 52.0\n",
      "女生中位数分数 54.0\n",
      "女生分数标准差 28.84\n"
     ]
    }
   ],
   "source": [
    "# 取出女生不同科目的成绩进行计算\n",
    "# 0 Python, 1数学 math, 2语文 Chinese\n",
    "girl_py_score = girls_data[:,0].copy()\n",
    "print('女生Python成绩如下：')\n",
    "print()\n",
    "girl_py_score.sort()\n",
    "print('简单排序', girl_py_score)\n",
    "print('去掉重复值', np.unique(girl_py_score))\n",
    "girls_py_min = np.min(girl_py_score)\n",
    "print('女生最低分数',girls_py_min)\n",
    "girls_py_max = np.max(girl_py_score)\n",
    "print('女生最高分数', girls_py_max)\n",
    "girls_py_max = np.round(np.mean(girl_py_score),0)\n",
    "print('女生平均分数', girls_py_max)\n",
    "girls_py_median = np.median(girl_py_score)\n",
    "print('女生中位数分数', girls_py_median)\n",
    "girls_py_std = np.round(np.std(girl_py_score),2)\n",
    "print('女生分数标准差', girls_py_std)\n",
    "\n",
    "\n",
    "print()\n",
    "print()\n",
    "girl_math_score = girls_data[:,1].copy()\n",
    "print('女生数学成绩如下：')\n",
    "print()\n",
    "girl_math_score.sort()\n",
    "print('简单排序', girl_math_score)\n",
    "print('去掉重复值', np.unique(girl_math_score))\n",
    "girls_math_min = np.min(girl_math_score)\n",
    "print('女生最低分数',girls_math_min)\n",
    "girls_math_max = np.max(girl_math_score)\n",
    "print('女生最高分数', girls_math_max)\n",
    "girls_math_mean = np.round(np.mean(girl_math_score),0)\n",
    "print('女生平均分数', girls_math_mean)\n",
    "girls_math_median = np.median(girl_math_score)\n",
    "print('女生中位数分数', girls_math_median)\n",
    "girls_math_std = np.round(np.std(girl_math_score),2)\n",
    "print('女生分数标准差', girls_math_std)\n",
    "\n",
    "\n",
    "print()\n",
    "print()\n",
    "girl_chinese_score = girls_data[:,2].copy()\n",
    "print('女生语文成绩如下：')\n",
    "print()\n",
    "girl_chinese_score.sort()\n",
    "print('简单排序', girl_chinese_score)\n",
    "print('去掉重复值', np.unique(girl_chinese_score))\n",
    "girls_chinese_min = np.min(girl_chinese_score)\n",
    "print('女生最低分数',girls_chinese_min)\n",
    "girls_chinese_max = np.max(girl_chinese_score)\n",
    "print('女生最高分数', girls_chinese_max)\n",
    "girls_chinese_mean = np.round(np.mean(girl_chinese_score),0)\n",
    "print('女生平均分数', girls_chinese_mean)\n",
    "girls_chinese_median = np.median(girl_chinese_score)\n",
    "print('女生中位数分数', girls_chinese_median)\n",
    "girls_chinese_std = np.round(np.std(girl_chinese_score),2)\n",
    "print('女生分数标准差', girls_chinese_std)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.2"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
